package com.liao.badminton.dto;

import com.liao.badminton.code.BaseField;
import com.liao.badminton.code.validation.Delete;
import com.liao.badminton.code.validation.Insert;
import com.liao.badminton.code.validation.Update;
import io.swagger.annotations.ApiModelProperty;
import com.liao.badminton.entity.BoutStat;
import javax.validation.constraints.NotNull;
import java.util.List;
import lombok.Data;
import com.liao.badminton.code.validation.FindDetail;
import java.math.BigDecimal;
import java.lang.String;
import java.util.Date;

/**
* @author liaocheng
* @date 2024-11-01
* description:录入对局统计表
*/
@Data
public class BoutStatDto extends BaseField {

    @ApiModelProperty(value = "id")
    @NotNull(message = "主键id不能为空",groups = {Update.class, FindDetail.class})
    private Long id;

    @ApiModelProperty(value = "录入记录id")
    private Long importRecordId;

    @ApiModelProperty(value = "群id;查询某人在某群的对局统计")
    private Long groupId;
    @ApiModelProperty(value = "用户群名称")
    private String userGroupName;

    @ApiModelProperty(value = "用户和群id")
    private Long userGroupRefId;

    @ApiModelProperty(value = "总局数")
    private Integer totalBout;

    @ApiModelProperty(value = "胜局数")
    private Integer winBout;

    @ApiModelProperty(value = "负局数")
    private Integer loseBout;

    @ApiModelProperty(value = "总得分:胜-负")
    private Integer totalScore;

    @ApiModelProperty(value = "奖励金币")
    private BigDecimal awardCoin;

    @ApiModelProperty(value = "文本内容:user_name的所有对局内容")
    private String txtContent;

    @NotNull(message = "主键id不能为空",groups = {Delete.class})
    private List<Long> delIds;  //批量删除ids

    //非数据库字段
    @ApiModelProperty(value = "1：总奖励，2：胜率，3：总局数")
    private Integer orderByType = 1 ;
    @ApiModelProperty(value = "1：升序(小->大)，2：降序（大->小）")
    private Integer orderByTypeDesc =2;

    public BoutStat invertEntity(){
        BoutStat dto = new BoutStat();
        BaseField.invert(this, dto);
        dto.setId(this.getId());
        dto.setImportRecordId(this.getImportRecordId());
        dto.setUserGroupRefId(this.getUserGroupRefId());
        dto.setTotalBout(this.getTotalBout());
        dto.setWinBout(this.getWinBout());
        dto.setLoseBout(this.getLoseBout());
        dto.setTotalScore(this.getTotalScore());
        dto.setAwardCoin(this.getAwardCoin());
        dto.setTxtContent(this.getTxtContent());
        return dto;
    }
}
